package com.joysuch.wwyt.workflow.entity;


import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * 业务流程菜单配置
 */

@Data
@Entity
@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Table(name = "WWYT_WORKFLOW_MENU")
@SQLDelete(sql = "update WWYT_WORKFLOW_MENU set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_WORKFLOW_MENU set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
public class WorkFlowMenu  implements Serializable {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @ApiModelProperty("主键ID")
    private Long id;

    @ApiModelProperty("业务流程ID")
    private Long workFlowId;

    @ApiModelProperty("显示顺序")
    private Integer showOrder;

    @ApiModelProperty("菜单名称")
    private String menuName;

    @ApiModelProperty("上级菜单")
    private String parentMenu;

    @ApiModelProperty("上级菜单Id")
    private Long parentMenuId;

    @ApiModelProperty("菜单URL")
    private String menuUrl;

    @ApiModelProperty("菜单图标")
    private String menuIcon;

    @ApiModelProperty("流程节点名称列表")
    private String taskNames;

    @ApiModelProperty("创建按钮")
    private String createButton;

    @ApiModelProperty("字段名称列表")
    private String fieldNames;

    @ApiModelProperty("操作按钮列表")
    private String optButtons;

    @ApiModelProperty("查找筛选字段列表")
    private String searchFields;

    @ApiModelProperty("列表数据： 0 =当前用户 1=所有用户")
    private Integer isAssignUser;

    @ApiModelProperty("节点指定人员字段列表")
    private String assignFields;

    @ApiModelProperty("是否是app菜单名称: 是;否")
    private String appFlag;

    @ApiModelProperty("app菜单名称")
    private String appName;

    @ApiModelProperty("异常状态 T显示 F隐藏")
    private String exceptionStatus;

    @ApiModelProperty("系统菜单id")
    private Long baseMenuId;

    @ApiModelProperty("默认字段")
    private String defaultFields;

    //通用字段
    @org.springframework.data.annotation.CreatedBy
    @ApiModelProperty("创建人")
    private Long createBy;

    @org.springframework.data.annotation.CreatedDate
    @ApiModelProperty("创建时间")
    private Date createTime;

    @org.springframework.data.annotation.LastModifiedBy
    @ApiModelProperty("更新人")
    private Long updateBy;

    @org.springframework.data.annotation.LastModifiedDate
    @ApiModelProperty("更新时间")
    private Date updateTime;

    @ApiModelProperty("租户")
    private Long tenentId;

    @ApiModelProperty("组织机构代码")
    private String orgCode;

    @ApiModelProperty("删除标记")
    private String deleteFlag;

    @ApiModelProperty("是否导出：1导出")
    private Integer showExport;
}
